#encoding:utf8
'''
列出当前的进程列表，等待用户输入pid，然后将其该进程杀死
'''
import os
import subprocess


def main():
	command	= os.getenv('help') + '\\ok\\tlist.exe'
	subprocess.Popen(command).wait()

	print(('-'*80))
	pid	= input('Input the process id to kill> ')
	try:
		int(pid)
		command	= 'ntsd -c q -p %s'%pid
		subprocess.Popen(command)
	except Exception as ex:
		print(('Invalid pid= %s'%pid))


if __name__=='__main__':
	main()
